/*
 * QGLWidgetAdapter.cpp  0.4.0 / Nov 28, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#include "QGLWidgetAdapter.h"

#include "GLComponentDelegate.h"

// QGLWidgetAdapter :: Public Constructor. -------------------------------------

/*!
 * \brief Constructs new QGLWidgetAdapter object.
 *
 * \param glComponent the GLComponent java object
 */
QGLWidgetAdapter::QGLWidgetAdapter(GLComponentDelegate *glComponentDelegate)
  : QGLWidget(), m_glComponentDelegate(glComponentDelegate)
{
  // empty constructor body
}

// QGLWidgetAdapter :: Overridden Member Functions. ----------------------------

/*!
 * \brief Calls initializeGL method of the GLComponent java object.
 */
void QGLWidgetAdapter::initializeGL()
{
  m_glComponentDelegate->callInitializeGL();
}

/*!
 * \brief Calls resizeGL method of the GLComponent java object.
 *
 * \param width the width
 * \param height the height
 */
void QGLWidgetAdapter::resizeGL(int width, int height)
{
  m_glComponentDelegate->callResizeGL(width, height);
}

/*!
 * \brief Calls paintGL method of the GLComponent java object.
 */
void QGLWidgetAdapter::paintGL()
{
  m_glComponentDelegate->callPaintGL();
}
